<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            font-size: 48px;
        }
        button{
            font-size: 48px;
        }
    </style>
</head>
<body>
hello

<div class="box" id="box"></div>

<button id="btn">调用鸿蒙代码</button>
<button id="btn2">调用鸿蒙代码2</button>

<script>

    document.getElementById("btn").onclick = function(){

      let str= objName.getData();
      document.getElementById("box").innerHTML = str;


   }
     document.getElementById("btn2").onclick = function(){

      let str= objName2.getName();
      document.getElementById("box").innerHTML = str;


   }
</script>
</body>
</html>